package com.hnhcyy.goods.pojo;

import com.hnhcyy.b2b.common.model.ResultCode;

public enum GoodsResultEnum implements ResultCode {
	
	
	GOODS_STOCKOUT(false, 1001, "商品库存不足"), 
	PACKAGE_ERROR(false, 1002, "查询套餐信息有误"), 
	SHOPPINCART_ADD_FAIL(false, 1003, "加入购物车失败"), 
	SHOPPINCART_UPDATE_FAIL(false, 1004, "更新购物车商品失败"), 
	SHOPPINCART_DELETE_FAIL(false, 1005, "删除购物车商品失败"),
	SPOLDMCHK_DELETE_FAIL(false, 2001, "删除老客户控销表数据失败"),
	SPMCHK_DELETE_FAIL(false, 2001, "删除客户控销加减表数据失败"),
	PARAM_MISSING(false, 1009, "缺少参数"),
	GOODS_UPDATE_FAIL(false, 1006, "更新商品失败"),
	;
	
	private boolean success;
	
	private int code;
	
	private String message;
	
	GoodsResultEnum(boolean success, Integer code, String msg) {
		this.success = success;
		this.code = code;
		this.message = msg;
	}
	
	/*public static GoodsResultEnum getEnumByCode(Integer code) {
		for (GoodsResultEnum resultEnum : GoodsResultEnum.values()) {
			if(resultEnum.code() == code) {
				return resultEnum;
			}
		}
		return UNKNOW_ERROR;
	}*/

	/*public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}*/

	@Override
	public boolean success() {
		return success;
	}

	@Override
	public int code() {
		return code;
	}

	@Override
	public String message() {
		return message;
	}
	
}
